/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package app.gui;

import app.gui.scene.SceneHolder;
import app.gui.scene.SceneObserver;
import app.gui.scene.SceneSubject;
import java.util.ArrayList;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;

/**
 *
 * @author sammael
 */
public class ExitScene extends SceneHolder {
    private String labelString = "Czy na pewno chcesz zakończyć aplikację ?";
    private Label textLbl;
    private Button yes,no;

    
    public ExitScene(SceneHolder previus){
        nextScene = previus.getScene();
        VBox vb = new VBox(spacing);
        textLbl = new Label(labelString);
        vb.setAlignment(Pos.CENTER);
        HBox hb = new HBox(30f);
        hb.setAlignment(Pos.CENTER);
        yes = new Button("Tak");
        yes.setOnAction(new EventHandler<ActionEvent>() {

            @Override
            public void handle(ActionEvent arg0) {
                System.exit(0);
            }
        });
        
        no = new Button("Nie");
        no.setOnAction(new EventHandler<ActionEvent>() {

            @Override
            public void handle(ActionEvent arg0) {
                notifyObservers();
            }
        });
        hb.getChildren().setAll(yes,no);
        vb.getChildren().setAll(textLbl,hb);
        scene = new Scene(vb,rootWidth,rootHeigh);
    }
    
}
